Inkjet printers have widely been used as the output device of the computer. Ink as an expendable for the inkjet printer is generally kept in an ink cartridge. One proposed method of measuring the residual quantity of ink kept in the ink cartridge utilizes a piezoelectric element to attain direct measurement, as disclosed in Japanese Patent Laid-Open Gazette No. 2001-147146.
This proposed method first applies a voltage wave to the piezoelectric element attached to the ink cartridge to vibrate a vibrating element of the piezoelectric element. The method then detects a variation in cycle of counter electromotive force, which is caused by remaining vibration in the vibrating element of the piezoelectric element after a lapse of standby time for damping the unnecessary vibration as noise, to measure the residual quantity of the expendable.
This prior art method, however, determines the standby time by counting the voltage wave output from the piezoelectric element, and therefore may underestimate the standby time when the noise is large enough to count even the voltage wave as noise. As a result, the noise cannot be damped sufficiently, and thereby deteriorating the reliability of the measurement.